home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / loancalc.arc / LOANRPAY.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1991-04-28  |  832 b   |  30 lines

  1. PROCEDURE RegPayLoan;
  2. VAR
  3.   NumPays, NumYears, ExtraPays: integer;
  4.   principal, percent, rate: real;
  5.  
  6. BEGIN { Main}
  7.   writeln('Regular Payment on a Loan');
  8.   REPEAT
  9.     writeln;
  10.     write('Principal: $');
  11.     readln(principal);
  12.     REPEAT
  13.       write('Number of payments per year? ')
  14.     UNTIL ReadInt(NumPays, 1, maxint);
  15.     REPEAT
  16.       write('Whole number of years: ');
  17.     UNTIL ReadInt(NumYears, 0, maxint);
  18.     REPEAT
  19.       write('Number of payments beyond last whole year: ')
  20.     UNTIL ReadInt(ExtraPays, 0, maxint);
  21.     write('Annual interest rate: (%) ');
  22.     readln(percent);
  23.     rate := (percent / Numpays) / 100;
  24.     writeln('Regular payment = $', principal * rate
  25.             / (1 - IntRaise(rate + 1, -NumPays
  26.             * NumYears - ExtraPays)):6:2);
  27.     writeln
  28.   UNTIL NotAgain
  29. END;
  30.